In list mode, accept the same mouse/wheel bindings on the cellview as on
authorMatthias Clasen <maclas@gmx.de>
Sun, 9 May 2004 06:01:57 +0000 (06:01 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 9 May 2004 06:01:57 +0000 (06:01 +0000)
Sun May  9 01:57:17 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcombobox.c (gtk_combo_box_list_button_released):
In list mode, accept the same mouse/wheel bindings on
the cellview as on the button.  (#136967)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index 934994bba468152a4bdd1d37ff0b6d611820e2e3..dfaa609df9123e4181237bce9ee0ba4bd5a072f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun May  9 02:01:13 2004  Matthias Clasen  <maclas@gmx.de>
+
+        Merge from 2.4:
+       
+       * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): 
+       In list mode, accept the same mouse/wheel bindings on 
+       the cellview as on the button.  (#136967)
+
 Sun May  9 01:25:37 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkiconfactory.c (add_to_cache): Actually count the
index 934994bba468152a4bdd1d37ff0b6d611820e2e3..dfaa609df9123e4181237bce9ee0ba4bd5a072f8 100644 (file)
@@ -1,3 +1,11 @@
+Sun May  9 02:01:13 2004  Matthias Clasen  <maclas@gmx.de>
+
+        Merge from 2.4:
+       
+       * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): 
+       In list mode, accept the same mouse/wheel bindings on 
+       the cellview as on the button.  (#136967)
+
 Sun May  9 01:25:37 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkiconfactory.c (add_to_cache): Actually count the
index 934994bba468152a4bdd1d37ff0b6d611820e2e3..dfaa609df9123e4181237bce9ee0ba4bd5a072f8 100644 (file)
@@ -1,3 +1,11 @@
+Sun May  9 02:01:13 2004  Matthias Clasen  <maclas@gmx.de>
+
+        Merge from 2.4:
+       
+       * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): 
+       In list mode, accept the same mouse/wheel bindings on 
+       the cellview as on the button.  (#136967)
+
 Sun May  9 01:25:37 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkiconfactory.c (add_to_cache): Actually count the
index 934994bba468152a4bdd1d37ff0b6d611820e2e3..dfaa609df9123e4181237bce9ee0ba4bd5a072f8 100644 (file)
@@ -1,3 +1,11 @@
+Sun May  9 02:01:13 2004  Matthias Clasen  <maclas@gmx.de>
+
+        Merge from 2.4:
+       
+       * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): 
+       In list mode, accept the same mouse/wheel bindings on 
+       the cellview as on the button.  (#136967)
+
 Sun May  9 01:25:37 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkiconfactory.c (add_to_cache): Actually count the
index 5e02eb2df0824eb556f8861c4a7b921b9ea8f243..a3d284682c07f927a99a087c734bcb4a02752b05 100644 (file)
@@ -2147,7 +2147,18 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
       gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view), 
                                          &GTK_WIDGET (combo_box)->style->base[GTK_WIDGET_STATE (combo_box)]);
 
-      gtk_widget_show (combo_box->priv->cell_view_frame);
+      combo_box->priv->box = gtk_event_box_new ();
+      gtk_event_box_set_visible_window (GTK_EVENT_BOX (combo_box->priv->box), 
+                                       FALSE);
+
+      gtk_container_add (GTK_CONTAINER (combo_box->priv->cell_view_frame),
+                        combo_box->priv->box);
+
+      gtk_widget_show_all (combo_box->priv->cell_view_frame);
+
+      g_signal_connect (combo_box->priv->box, "button_press_event",
+                       G_CALLBACK (gtk_combo_box_list_button_pressed), 
+                       combo_box);
     }
 
   combo_box->priv->tree_view = gtk_tree_view_new ();
@@ -2226,6 +2237,11 @@ gtk_combo_box_list_destroy (GtkComboBox *combo_box)
                                         0, 0, NULL,
                                         gtk_combo_box_list_button_pressed,
                                         NULL);
+  g_signal_handlers_disconnect_matched (combo_box->priv->box,
+                                        G_SIGNAL_MATCH_DATA,
+                                        0, 0, NULL,
+                                        gtk_combo_box_list_button_pressed,
+                                        NULL);
 
   /* destroy things (unparent will kill the latest ref from us)
    * last unref on button will destroy the arrow
@@ -2245,6 +2261,7 @@ gtk_combo_box_list_destroy (GtkComboBox *combo_box)
     {
       gtk_widget_unparent (combo_box->priv->cell_view_frame);
       combo_box->priv->cell_view_frame = NULL;
+      combo_box->priv->box = NULL;
     }
 
   gtk_widget_destroy (combo_box->priv->tree_view);
@@ -2280,7 +2297,7 @@ gtk_combo_box_list_button_pressed (GtkWidget      *widget,
   if (ewidget == combo_box->priv->tree_view)
     return TRUE;
 
-  if ((ewidget != combo_box->priv->button) ||
+  if ((ewidget != combo_box->priv->button && ewidget != combo_box->priv->box) ||
       gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (combo_box->priv->button)))
     return FALSE;